<?php

class Webote_Form_ArticleInput extends Webote_Form
{

    public function init()
    {
        $this->setAttrib('id', 'articleForm');

        $this->setAction('/admin/article/save');

        // Display Group #1 : Article content

        $this->addElement('text', 'title', array(
            'decorators' => $this->_standardElementDecorator,
            'label' => 'Title:'
        ));

        $this->addElement('textarea', 'body', array(
            'decorators' => $this->_standardElementDecorator,
            'label' => 'Article content:',
            'rows' => '15',
            'cols' => '70'
        ));

        $this->addElement('submit', 'submit', array(
            'decorators' => $this->_standardElementDecorator,
            'label' => 'Save'
        ));

        $this->addDisplayGroup(
            array('title', 'body', 'submit'), 'articleContent',
            array(
                'disableLoadDefaultDecorators' => true,
                'decorators' => $this->_standardGroupDecorator,
                'legend' => 'Article content'
            )
        );
    }

}